Title Banner

Previous Book Contents Book Index Next

Inside Macintosh: OpenDoc Class Reference /
Part 1 - Classes and Methods / ODDraft


AcquireLink

The AcquireLink method returns a reference to the link object whose data is stored in the specified storage unit or that can be constructed from the given link specification.

ODLink AcquireLink (in ODStorageUnitID id, 
                in ODLinkSpec linkSpec);
id
The ID of the storage unit providing the link data, or kODNULLID if the link is to be constructed.
linkSpec
A reference to a link-specification object from which the link is to be constructed, or kODNULL is the id parameter is not null.
return value
A reference to the specified link object.
DISCUSSION
If your part is the destination of a link, you call this method to create a link object; you also call this method in your part's InitPartFromStorage method to re-create the link object from its stored data.

If the id parameter is not null, the linkSpec parameter is ignored. In that case, the id parameter must be the ID of the link object's storage unit, and this method re-creates the link object from the content of the specified storage unit.

If the id parameter is null, the linkSpec parameter must be a link-specification object returned by a previous call to the CreateLinkSpec method. In that case, this method uses the information in the link-specification object to construct the link object.

This method increments the reference count of the returned link object. When you have finished using that link object, you should call its Release method.

EXCEPTIONS
kODErrCannotAcquireLink
Cannot re-create the requested link object from the specified storage unit or link-specification object.
kODErrInsufficientInfoInParams
No link object was specified; the id parameter is kODNULLID and the linkSpec parameter is kODNULL.
SEE ALSO
The ODStorageUnitID type (page 903).
The ODDraft::CreateLinkSpec method (page 167).
The ODPart::InitPartFromStorage method (page 530).
The ODLink class (page 348).
The ODLinkSpec class (page 390).
"Creating a Link at the Destination" on page 384 in OpenDoc Programmer's Guide.
Table 11-1 on page 466 in OpenDoc Programmer's Guide.
"Reading Links in InitPartFromStorage" on page 394 in OpenDoc Programmer's Guide.
"Reading Links for Data Transfer" on page 395 in OpenDoc Programmer's Guide.


Previous Book Contents Book Index Next

© Apple Computer, Inc.
17 JUL 1996




Navigation graphic, see text links

Main | Page One | What's New | Apple Computer, Inc. | Find It | Contact Us | Help